package com.xuebang.admin.entity;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;


@Table(name="positions")
public class Position {
	@Id
	private Long positionId;
	@Column
	private String name;
	@Column
	private Long positionIndex;
	@Column
	private Long departmentId;
	@Column
	private String isLeader;
	private Department department;
	
	
	public Department getDepartment() {
		return department;
	}
	public void setDepartment(Department department) {
		this.department = department;
	}
	public String getIsLeader() {
		return isLeader;
	}
	public void setIsLeader(String isLeader) {
		this.isLeader = isLeader;
	}
	public Long getPositionId() {
		return positionId;
	}
	public void setPositionId(Long positionId) {
		this.positionId = positionId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Long getPositionIndex() {
		return positionIndex;
	}
	public void setPositionIndex(Long positionIndex) {
		this.positionIndex = positionIndex;
	}
	public Long getDepartmentId() {
		return departmentId;
	}
	public void setDepartmentId(Long departmentId) {
		this.departmentId = departmentId;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((departmentId == null) ? 0 : departmentId.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result
				+ ((positionId == null) ? 0 : positionId.hashCode());
		result = prime * result
				+ ((positionIndex == null) ? 0 : positionIndex.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Position other = (Position) obj;
		if (departmentId == null) {
			if (other.departmentId != null)
				return false;
		} else if (!departmentId.equals(other.departmentId))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (positionId == null) {
			if (other.positionId != null)
				return false;
		} else if (!positionId.equals(other.positionId))
			return false;
		if (positionIndex == null) {
			if (other.positionIndex != null)
				return false;
		} else if (!positionIndex.equals(other.positionIndex))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "Positions [positionId=" + positionId + ", name=" + name
				+ ", positionIndex=" + positionIndex + ", departmentId="
				+ departmentId + "]";
	}
	
}
